import pandas as pd
import pymysql
from sqlalchemy import create_engine


conn = pymysql.connect(host = "192.168.0.211",user = "root",passwd = "root",db = "kechuang_middata",charset="utf8")

df = pd.read_sql("select * from expert_wide_in", con=conn)
df.head()
conn.close()

yconnect = create_engine('mysql+pymysql://root:root@192.168.0.211:3306/kechuang_middata?charset=utf8')
pd.io.sql.to_sql(df,'expert_wide_all', yconnect, schema='kechuang_middata', if_exists='append')
